package com.example.czxyindex.web.remote;

import com.yc.czxy.bean.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("czxy-product")
@RequestMapping("product")
public interface IProductAction {

    /**
     * 调用远程的添加商品方法
     * @param product
     * @return
     */
    @PostMapping("addProduct")
    Result<Product> addProduct(@RequestBody Product product);
    /**
     * 调用远程的删除商品方法
     * @param product
     * @return
     */
    @PostMapping("deleteProductBypid")
    Result<Product> deleteProductBypid(@RequestBody Product product);

    @RequestMapping("queryAll")
    List<Product> queryAll();

    @RequestMapping("queryByPid")
    List<Product> queryByPid(@RequestParam("pid") Integer pid);
    /**
     * 调用远程的添加标签的方法
     * @param label1
     * @return
     */
    @PostMapping("addLabel")
    Result<Label1> addLabel(@RequestBody Label1 label1);

    /**
     * 查询所有的主类别
     * @return
     */
    @RequestMapping("selectAllCategory")
    List<Category> selectAllCategory();

    @RequestMapping("selectCategorySecondBycid")
    List<Categorysecond> selectCategorySecondBycid(@RequestParam("cid") Integer cid);

    @GetMapping("selectProductByUid")
    List<Product> selectProductByUid(@RequestParam("uid") Integer uid);
}
